<?php
class RubricsController extends Controller {

    public $defaultAction = 'index';
    
	public function actionIndex() {
        $this->pageTitle = Yii::t('app', 'Рубрики');
        $st_id = intval(CHttpRequest::getParam('st_id'));
        $rubrics = Yii::app()->basestatic->rubrics($st_id);
		$this->render('index', array(
            'rubrics' => $rubrics,
            'st_id' => $st_id,
        ));
	}
    
    
    public function actionSingle() {
        $this->pageTitle = Yii::t('app', 'Рубрика');
        $st_id = intval(CHttpRequest::getParam('st_id'));
        $rubric_id = intval(CHttpRequest::getParam('rid'));
        $rubrics = Yii::app()->basestatic->rubrics(intval($st_id));
        $rubric = isset($rubrics[$rubric_id]) ? $rubrics[$rubric_id] : array();
        
		$this->render('single', array(
            'rubric' => $rubric,
            'st_id' => $st_id,
        ));
        
    }

}

?>